package com.lixinlei.springboot_servlet.controller.argumentsresolver.RequestBody;

import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping(path = "/request/body")
public class RequestBodyController {

    @RequestMapping(path = "/student")
    public Student testRequestBody(@Valid @RequestBody Student student, BindingResult bindingResult) {

        System.out.println("****************testRequestBody()");
        return student;
    }

}
